<!-- This is the sidebar of the wiki - this should probably have a float left div with lists -->
<div id="wiki-navigation">
<h3><%= class_name %> Navigation</h3>
<ul>
  <li><%= link_to("Main <%= class_name %> Page", <%= file_name %>_index_path) %></li>
  <li><%= link_to 'Create a new wiki page', new_<%= file_name %>_path %></li>
  <li><%= link_to('Upload a file', new_asset_path) %></li>
  <li><%= link_to("View a random article", <%= file_name %>_path("Random")) %></li>
  <li><%= link_to("See recent changes", changes_<%= file_name %>_path) %></li>
</ul>

<h3>Search the <%= class_name %></h3>
    <p><%= form_tag(search_<%= file_name %>_path, :method => :get)%>
    	<input type="search" id="search_wiki" name="<%= file_name %>_query" 
    	       placeholder="Search <%= class_name %>" 
    		   autosave="yes" results="10" maxlength="255" value="<%= params[:<%= file_name %>_query] %>" />
  	<%= submit_tag "Search" %>
  	</form></p>
  
    <script type="text/javascript">
    isSafari = (navigator.userAgent.indexOf("Safari") > 0);
    if (!isSafari) {
      element = document.getElementById('search_wiki');
      if (element.value == '') element.value="Search <%= class_name %>";
      
      Event.observe(element, 'click', function() { 
        if (element.value == 'Search <%= class_name %>') element.value = '' });
      
      Event.observe(element, 'focus', function() { 
        if (element.value == 'Search <%= class_name %>') element.value = '' });
  
      Event.observe(element, 'blur',  function() { 
        if (element.value == '') element.value = 'Search <%= class_name %>' });
    }
    </script>

<h3>Categories</h3>

<ul>
  <% # get the wiki tags - categories is only used by wikis %>
  <% for category in SGTag.find(:all, :include => "sg_taggings", :conditions => ["context = ?", 'categories'], :order => "name")%>
    <li><%= link_to(category.name, <%= file_name %>_category_path(category.name)) %></li>
  <% end %>
</ul>


<h3>Tracks</h3>

<ul>
  <% # get the wiki tags - categories is only used by wikis %>
  <% for trk_page in <%= class_name %>Page.find_tagged_with("Tracks", :on => :categories) %>
    <li><%= link_to(trk_page.title, <%= file_name %>_path(trk_page.slug)) %></li>
  <% end %>
</ul>


</div>



